const path = require("path");
const fs = require("fs");
import { setTargetConfig } from "./setTargetConfig";

const getTempLateCode = async (config) => {
 let scrPath = path.join(
  __dirname,
  "../template",
  `${config.template}-template`
 );
 const targetPath = path.join(process.cwd(), config.name);
 fs.cpSync(scrPath, targetPath, { recursive: true });
 await setTargetConfig(targetPath, config);
};

const create = async (configs) => {
 getTempLateCode(configs);
};

export default create;
